# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=slock
pkgver=1.5
pkgrel=1
pkgdesc="A simple screen locker for X"
url="https://tools.suckless.org/slock/"
arch="all"
license="MIT"
makedepends="libxext-dev libxrandr-dev linux-headers"
options="suid !check" # no test suite
subpackages="$pkgname-doc"
source="https://dl.suckless.org/tools/slock-$pkgver.tar.gz
	explicit-bzero.patch"

# secfixes:
#   1.3-r3:
#     - CVE-2016-6866

prepare() {
	default_prepare
	sed -i -e '/CFLAGS/{s/-Os//;s/=/+=/}' \
		-e '/LDFLAGS/{s/-s//;s/=/+=/}' \
		config.mk
}

build() {
	make X11INC=/usr/include/X11 X11LIB=/usr/lib/X11
}

package() {
	make PREFIX=/usr DESTDIR="$pkgdir" install
}

sha512sums="
2402b1e49f5dbe06cca2f3a31efedce6359413b240f2b98c57147483591a873c3c5457dbf6707485167002ff6d7ee0e9005d9fa506a51bf71337624e8728bb43  slock-1.5.tar.gz
4b445d9553dbe977ac0c6232c8c429449e5aa14be6f9f509eb569a6b9ecffded4bddb1013859f8bcd119be1fef4b13c8a618795f2dfc6e9c8f5413d0fe8410e8  explicit-bzero.patch
"
